﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HeatExchanger.Model.CoolingTower
{
    class CoolingTowerModel
    {
        CoolingTower cool = new CoolingTower();
        CoolingtowerResult res = new CoolingtowerResult();
        public CoolingtowerResult ImplementCalculation(CoolingTower coolt)
        {
            cool = coolt;
            res.DbInWaterTemp = InWaterTemp();
            res.DbNominalWaterFlow = CoolingWaterFlow();
            res.DbOutWaterTemp = OutWaterTemp();
            res.DbSumCoolingCapacity = Coolingcapacity();
            return res;

        }
        public double Airtemperature()
        {
            cool.DbAirTemp = (cool.DbAverageTempMax + cool.DbMaxTempe) / 2;
            return cool.DbAirTemp;
        }
        public double InWaterTemp()
        {
            cool.DbWaterTemp = cool.DdTempeWet + 5;
            return cool.DbWaterTemp;
        }
        public double OutWaterTemp()
        {
            cool.DbOutWaterTemp = InWaterTemp() + 5;
            return cool.DbOutWaterTemp;
        }
        public double RefrigerantTemp()
        {
            cool.DbRefrigerantTemp = OutWaterTemp() + 5;
            return cool.DbRefrigerantTemp;
        }
        public double CoolingWaterFlow()
        {
            cool.DbCoolingWaterFlow = cool.DbCondenserCalory / (20950);
            return cool.DbCoolingWaterFlow;
        }
        public double Coolingcapacity()
        {
            cool.DbCoolingCapacity = cool.DbCondenserCalory / cool.DbCorrectionFactor;
            return cool.DbCoolingCapacity;
        }
    }
}
